<template>
  <div>
    <router-view v-if="isRouterAlive"></router-view>
  </div>

</template>



<script>
export default {
  name: "App",
  provide(){
    return {
      reload: this.reload
    }
  },
  data(){
    return{
      isRouterAlive : true
    }
  },
  // components: {},
  // created() {
  //   // 存储账号信息的代码,防止刷新后登录信息消失，具体意思，之后研究
  //   if (sessionStorage.getItem("store")) {
  //     this.$store.replaceState(
  //       Object.assign({}, this.$store.state, JSON.parse(sessionStorage.getItem("store")))
  //     );
  //   }
  //   window.addEventListener("beforeunload", () => {
  //     sessionStorage.setItem("store", JSON.stringify(this.$store.state));
  //   });
  // },
  methods: {
    reload(){
      this.isRouterAlive = false;
      this.$nextTick(function(){
        this.isRouterAlive = true
      })
    }
  },
};
</script>
<style></style>